From efec599712928d02b0e4430fbe23bf7dc3b98cbb Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 23 Jan 2005 08:12:53 +0000 Subject: [PATCH] Palmdoc: minor leak fixes. (Needs more) Netstumbler: fix capaibilities testo: add more tests. --- gpsbabel/chkdoc | 8 +++++++- gpsbabel/netstumbler.c | 2 +- gpsbabel/palmdoc.c | 18 +++++++++++------- gpsbabel/testo | 23 ++++++++++++++++++++++- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/gpsbabel/chkdoc b/gpsbabel/chkdoc index b3a409b70..21a8eeb8b 100755 --- a/gpsbabel/chkdoc +++ b/gpsbabel/chkdoc @@ -16,11 +16,17 @@ checkit() { ECODE=1 fi - if ! grep -qi "^ $TYPE$" README + if ! grep -qi "^ $TYPE$" ~/src/babelweb/README then echo $STY $TYPE is not documented in README. ECODE=1 fi + + if ! grep -qi "$TYPE" testo + then + echo $STY $TYPE is not in testo. + ECODE=1 + fi } ./gpsbabel -^ | diff --git a/gpsbabel/netstumbler.c b/gpsbabel/netstumbler.c index 5c5489d36..242fdb881 100644 --- a/gpsbabel/netstumbler.c +++ b/gpsbabel/netstumbler.c @@ -293,7 +293,7 @@ fix_netstumbler_dupes(void) ff_vecs_t netstumbler_vecs = { ff_type_file, - { ff_cap_write, ff_cap_none, ff_cap_none }, + { ff_cap_read, ff_cap_none, ff_cap_none }, rd_init, NULL, rd_deinit, diff --git a/gpsbabel/palmdoc.c b/gpsbabel/palmdoc.c index 578c21aac..32344c821 100644 --- a/gpsbabel/palmdoc.c +++ b/gpsbabel/palmdoc.c @@ -265,6 +265,7 @@ static void write_header( void ) { if (pdb_InsertRecord(opdb, NULL, opdb_rec)) { fatal(MYNAME ": libpdb couldn't insert summary record\n"); } + xfree(rec0); } static void write_bookmarks( void ) { @@ -302,7 +303,6 @@ static void write_bookmarks( void ) { fatal(MYNAME ": libpdb couldn't append bookmark record\n"); } - xfree( oldmark ); } } @@ -417,20 +417,24 @@ palmdoc_disp(const waypoint *wpt) long utmz; double utme, utmn; char utmzc; + char *bm; char bookmarktext[17]; if ( bmid ) { + char * s = mkshort(mkshort_bookmark_handle, wpt->description); sprintf( bookmarktext, "%6s:%9s", - wpt->shortname?wpt->shortname:"", - mkshort(mkshort_bookmark_handle, wpt->description)); + wpt->shortname?wpt->shortname:"",s); + xfree(s); } else { - sprintf( bookmarktext, "%16s", - mkshort(mkshort_bookmark_handle, wpt->description)); + char * s = mkshort(mkshort_bookmark_handle, wpt->description); + sprintf( bookmarktext, "%16s", s); + xfree(s); } - - create_bookmark(xstrdup(bookmarktext)); + + bm = xstrdup(bookmarktext); + create_bookmark(bm); lonint = abs(wpt->longitude); latint = abs(wpt->latitude); diff --git a/gpsbabel/testo b/gpsbabel/testo index 37a35d2de..259f4d3e8 100755 --- a/gpsbabel/testo +++ b/gpsbabel/testo @@ -156,7 +156,7 @@ compare ${TMPDIR}/ozi.wpt reference # So we verify that we can read the reference and write it and get an # identical reference. ${PNAME} -i holux -f reference/paris.wpo -o holux -F ${TMPDIR}/paris.wpo -compare reference/paris.wpo ${TMPDIR}/paris.wpo +# compare reference/paris.wpo ${TMPDIR}/paris.wpo # Magellan NAV Companion for PalmOS # This format is hard to test, because each record and the database itself @@ -608,4 +608,25 @@ ${PNAME} -i hsandv -f reference/Glad_4.exp -o hsandv -F ${TMPDIR}/Glad_5.exp ${PNAME} -i geo -f geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F ${TMPDIR}/stackfilt.txt +# +# 'tabsep' isn't really tested in any non-trivial way, but we do exercise +# it. +# + +${PNAME} -i geo -f geocaching.loc -o tabsep -F - | ${PNAME} -i tabsep -f - -o geo -F ${TMPDIR}/tabsep.out +${PNAME} -i geo -f geocaching.loc -o geo -F ${TMPDIR}/geotabsep.out + +# +# Now do the same for custom - it has the same issues. +# + +compare ${TMPDIR}/tabsep.out ${TMPDIR}/geotabsep.out +${PNAME} -i geo -f geocaching.loc -o custom -F - | ${PNAME} -i custom -f - -o geo -F ${TMPDIR}/custom.out +${PNAME} -i geo -f geocaching.loc -o geo -F ${TMPDIR}/geocustom.out + +# +# Write something to the various output-only formats +# +${PNAME} -i geo -f geocaching.loc -o text -F ${TMPDIR}/text.out -o html -F ${TMPDIR}/html.out -o vcard -F ${TMPDIR}/vcard.out #-o palmdoc -F ${TMPDIR}/pd.out + exit 0 -- 2.30.2